import type { App } from "vue"

interface IUse {
  install: (app: App, ...options: any[]) => void
}

const installList = new Set()

export function myUse<T extends IUse>(app: App, plugin: T, ...options: any[]) {
  if (installList.has(plugin)) return console.error('插件已经安装')
  plugin.install(app, ...options)
  installList.add(plugin)
}